(function($, doc) {
	mui.init();
	var userInfo = app.getState();
	var uid = userInfo.user_id;
	var player = document.createElement('audio');
	player.src = '../../static/sound/comin.mp3';
	player.volume = 1;
	player.loop = true;
	player.play();
	$.plusReady(function(){
		var mainid = localStorage.getItem('mainpage');
		var mainWin = plus.webview.getWebviewById(mainid);
		var comeId = plus.webview.currentWebview().user_id;
		var comeName = plus.webview.currentWebview().name;
		var comeAvatar = app.avatar(comeId, '../../static/images/1.png');
		doc.getElementById('userimg').src = comeAvatar;
		doc.getElementById('username').innerHTML = comeName;
		document.getElementById("refused").addEventListener('tap', function(){
			player.pause();
			plus.webview.currentWebview().close();
			var msgInfo = {type : 'cutvideoTo', comeId : comeId, comeName : comeName, uid : uid, name : userInfo.name};
			mui.fire(mainWin, 'cutvideoTo', msgInfo);
			
		});
		doc.getElementById('videoon').addEventListener('tap', function(){
			//mui.toast('开发中！');
			player.pause();
			plus.webview.currentWebview().close();
		});
	});
	
	
}(mui, document));